package com.grpc.server.config;

import io.grpc.netty.NettyServerBuilder;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Created by 石头哥哥 on 9/5/16.
 * PACKAGE_NAME:  com.server
 * COMMENT :
 */
@Configuration
public class PropertiesConfig {

    @Value("${grpc_port}")
    private String grpc_port;
    @Value("${certChain}")
    private String certChain;
    @Value("${privateKey}")
    private String privateKey;


    @Bean
    public NettyServerBuilder nettyServerBuilder(){
        return NettyServerBuilder.forPort(Integer.parseInt(grpc_port));
    }


    public String getGrpc_port() {
        return grpc_port;
    }

    public String getCertChain() {
        return certChain;
    }

    public String getPrivateKey() {
        return privateKey;
    }
}
